__author__ = 'dracher'
import os

#parameters used to extract data from origin excel file
USEFUL_COLUMN_INDEX = (2, 4, 5, 6, 7, 8, 9, 10)


#indicate http or https
HTTPS_FLAG = 1

#generating xls file starts from row 20, col 1


#use to detect which row is the first one that contains real test data.
DATA_START_FLAG = 'Expected Behavior'

ALLOWED_ACTION_NAME = ("GET", "PUT", "POST", "DELETE", "LOCAL")

import httplib
HTTP_RETURN_CODE = sorted([getattr(httplib, i) for i in dir(httplib) \
                            if isinstance(getattr(httplib, i), int) and (getattr(httplib, i)) < 511])[1:]

MAX_TREE_NUMBER_IN_ONE_SHEET = 20

ROOT_PATH = "/".join(os.path.dirname(__file__).split('/')[:-1])
TEST_RESULT_PATH = os.path.join(ROOT_PATH, 'testResult')
TEST_MATERIAL_PATH = os.path.join(ROOT_PATH, 'testMaterial')
DTREE_PATH = os.path.join(TEST_MATERIAL_PATH, 'DiscoverTrees')
TSO_FILE_PATH = os.path.realpath(os.path.join('.','config','tso.xls'))
TEMPLATE_FILE_PATH = os.path.realpath(os.path.join('.','testMaterial','Farad_LEDM_Test_tmplate.xls'))
CAPRESOURCE_PATH = os.path.realpath(os.path.join('.', 'capResource'))
TEST_RESULT_PATH1 = os.path.join(ROOT_PATH, 'capResource')                      #添加capResource的路径

VALID_HEAD_COLUMN_NAME = ('Description', 'Expected Behavior', 'Output File', 'Input File')

WRITE_VALID_HEAD_COLUMN_NAME = ('Copy','Asset','Put-Post-Get','', '','Description', 'Expected Behavior', 'Output File','Input File')


#DiscoveryTree Query xPath
DT_XPATH = ('/ledm:DiscoveryTree/ledm:SupportedTree/dd:ResourceURI',
            '/ledm:DiscoveryTree/ledm:SupportedIfc/ledm:ManifestURI',
            '/ledm:DiscoveryTree/ledm:SupportedFeature/dd:ResourceURI',)

CASE_NAME_PREFIX = ('Copy', 'Scan', 'Fax', 'Network', 'Settings', 'Others')

PRNCFGDYN2_NAME = ['AlternativeLetterheadMode', 'PJLCommands', 'PSCommands']